from django.db import models
from apps.common.base.models import BaseModel

class ValidateCode(BaseModel):
    '''短信验证模型'''
    
    status_choics = (
        (0, "未验证"),
        (1, "已发送"),
        (2, "已验证"),
        (3, "已失效"),
    )

    user = models.ForeignKey('user.UserModel', related_name='validateCode_user', verbose_name='用户', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    phone = models.CharField("手机号", max_length=200,blank=True,null=True)
    code = models.CharField("验证码", max_length=200,blank=True,null=True)
    content = models.CharField("内容", max_length=200,blank=True,null=True)
    status = models.IntegerField("状态", choices=status_choics, default=0)
    class Meta:
        verbose_name = '短信验证模型'
        verbose_name_plural = verbose_name